/**
 * Created by liuqingxia on 2016/5/4.
 */

/**
 * 显示主备切提示框
 */
function showRemoveTip(e, modalId) {
    adjustTipModalPos(getMouseY(e));
    $("#" + modalId).modal("show");
}


/**
 * 调整主备切提示框的位置
 * @param x
 */
function adjustTipModalPos(y) {
    //console.log("调整主备切提示框位置，x：" + x, "y: " + y);
    var modalEle = $('#switchBackup-tip-modal');
    var containerWidth = $("#page-wrapper").width();
    var modalWidth = modalEle.find(".modal-dialog").width() + 500;
    var x = (containerWidth - modalWidth) / 2;
    y = y - 200;
    modalEle.css({'left': x + 'px', 'top': y + 'px'});
}